//
//  BookingListCell.m
//  whopaidforit
//
//  Created by Hoang Vu on 2/3/13.
//  Copyright (c) 2013 Hoang Vu. All rights reserved.
//

#import "BookingListCell.h"

@implementation BookingListCell

@synthesize picture, lblName, lblDate, lblPrice, lblQuantity;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    picture = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 45, 45)];
    UIImage *image = [UIImage imageNamed:@"member"];
    picture.image = image;
    [StyleControl setBorderStyle:picture];
    [self.contentView addSubview:picture];
    
    lblName = [[UILabel alloc] initWithFrame:CGRectMake(60, 2, 100, 21)];
    lblName.backgroundColor = [UIColor clearColor];
    [lblName setTextColor:[UIColor colorWithRed:0.247 green:0.243 blue:0.243 alpha:1.0]];
    lblName.text = @"Profielfoto";
    lblName.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:lblName];
    
    lblDate = [[UILabel alloc] initWithFrame:CGRectMake(60, 20, 100, 21)];
    lblDate.backgroundColor = [UIColor clearColor];
    [lblDate setTextColor:[UIColor colorWithRed:0.247 green:0.243 blue:0.243 alpha:1.0]];
    lblDate.text = @"07-02-2013";
    [StyleControl setDateStyle:lblDate];
    [self.contentView addSubview:lblDate];
    
    lblPrice = [[UILabel alloc] initWithFrame:CGRectMake(60, 34, 100, 21)];
    lblPrice.backgroundColor = [UIColor clearColor];
    [lblPrice setTextColor:[UIColor colorWithRed:0.247 green:0.243 blue:0.243 alpha:1.0]];
    lblPrice.text = @"$ 123,34";
    [StyleControl setPriceStyle:lblPrice];
    [self.contentView addSubview:lblPrice];
    
    UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(280, 10, 30, 30)];
    UIImage *iconimage = [UIImage imageNamed:@"userIcon"];
    icon.image = iconimage;
    [self.contentView addSubview:icon];
    [icon release];
    
    
    lblQuantity = [[UILabel alloc] initWithFrame:CGRectMake(290, 35, 100, 21)];
    lblQuantity.backgroundColor = [UIColor clearColor];
    [lblQuantity setTextColor:[UIColor colorWithRed:0.247 green:0.243 blue:0.243 alpha:1.0]];
    lblQuantity.text = @"3x";
    [StyleControl setDateStyle:lblQuantity];
    [self.contentView addSubview:lblQuantity];
    [lblQuantity release];
    //for background
    GraphicDrawView *cellView = [[GraphicDrawView alloc] init];
    cellView.optionDraw = @"cell";
    self.backgroundView = cellView;
    [cellView release];
    
    //for hover background
    GraphicDrawView *cellHView = [[GraphicDrawView alloc] init];
    cellHView.optionDraw = @"cell";
    cellHView.optionHover = NO;
    self.selectedBackgroundView = cellHView;
    [cellHView release];
    
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
